package com.klod.data.mapping


import com.klod.data.bean.BannerDetailBean
import org.jetbrains.exposed.sql.ResultRow
import org.jetbrains.exposed.sql.Table

object BannersTable : Table("news_banner") {

    val bId = integer("id").autoIncrement()
    val imgUrl = text("img_url")
    val content = text("content")

    override val primaryKey = PrimaryKey(bId)
}

fun daoToModel(dao: ResultRow) =  BannerDetailBean(
    bId = dao[BannersTable.bId],
    imageUrl = dao[BannersTable.imgUrl],
    content = dao[BannersTable.content]
)